from django.urls import path
from .views import (
    LoginView, LogoutView, DashboardStatsView, UserListView,
    UserManageView, UserStatusView
)

app_name = 'users'

urlpatterns = [
    # 认证相关
    path('auth/login/', LoginView.as_view(), name='login'),
    path('auth/logout/', LogoutView.as_view(), name='logout'),

    # 仪表盘
    path('dashboard/stats/', DashboardStatsView.as_view(), name='dashboard_stats'),

    # 用户管理
    path('users/', UserListView.as_view(), name='user_list'),  # GET - 用户列表
    path('users/create/', UserManageView.as_view(), name='user_create'),  # POST - 创建用户
    path('users/<int:user_id>/', UserManageView.as_view(), name='user_manage'),  # GET/PUT/DELETE - 用户详情/更新/删除
    path('users/<int:user_id>/status/', UserStatusView.as_view(), name='user_status'),  # PATCH - 更新用户状态
]